<?php

namespace app\controller;

use think\facade\Filesystem;
use think\facade\Request;
use think\annotation\route;
use think\response\Json;

class ImageController
{
    /**
     * @route ("putImg")
     * @return Json
     */
    public function getImageFromClient()
    {
        $file = Request::file('file');
        $url = Filesystem::disk('public')->putfile('bookImg', $file, 'md5');
        return json($url);
    }
}